<template>
  <div class="container">
    <van-nav-bar
      left-text="返回"
      left-arrow
      title="市集"
      class="container-head"
    >
      <template #left>
        <van-icon name="location-o" size="16" />
        <p class="position">深圳市</p>
      </template>
      <template #right>
        <router-link to="/shop">
          <van-icon name="cart-o" size="20" />
          <div class="badge">0</div>
        </router-link>
      </template>
    </van-nav-bar>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item>
        <img src="./images/banner1.jpg" alt="" />
      </van-swipe-item>
      <van-swipe-item>
        <img src="./images/banner2.jpg" alt="" />
      </van-swipe-item>
      <van-swipe-item>
        <img src="./images/banner3.jpg" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  components:{
    ...mapState(["shopCarList"])
  }
};
</script>

<style scoped lang="less">
.container-head {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  .badge {
    position: fixed;
    right: 0.1rem;
    top: 0.08rem;
    height: 0.34rem;
    width: 0.34rem;
    background-color: #1989fa;
    border-radius: 50%;
    color: #fff;
    font-size: 0.24rem;
    line-height: 0.36rem;
    text-align: center;
  }
}
.my-swipe {
  margin-top: 0.92rem;
  height: 3.5rem;
}
.van-nav-bar {
  background-color: #fff;
  .van-nav-bar__content {
    height: 1rem;

    .van-icon {
      color: #333;
    }
  }
}

.my-swipe {
  .van-swipe-item {
    img {
      height: 100%;
      width: 100%;
    }
  }
}
</style>